using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using QLKS.DataLayer.BusinessObjects;
using QLKS.DataLayer.Base;

namespace QLKS.DataLayer.ManagerObjects
{
    public partial interface IPhongManager : IManagerBase<Phong, string>
    {
		// Get Methods
		IList<Phong> GetByMaLoaiPhong(System.Int32 loaiPhong);
    }

    partial class PhongManager : ManagerBase<Phong, string>, IPhongManager
    {
		#region Constructors
		
		public PhongManager() : base()
        {
        }
        public PhongManager(INHibernateSession session) : base(session)
        {
        }
		
		#endregion
		
        #region Get Methods

		
		public IList<Phong> GetByMaLoaiPhong(System.Int32 loaiPhong)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Phong));
			
			
			ICriteria loaiPhongCriteria = criteria.CreateCriteria("LoaiPhong");
            loaiPhongCriteria.Add(NHibernate.Criterion.Expression.Eq("Id", loaiPhong));
			
			return criteria.List<Phong>();
        }
		
		#endregion
    }
}